#ifndef __TM1640_H__
#define __TM1640_H__
#include "gd32f10x.h"
/* 数据操作命令 */
#define TM1640_CMD_DATA_FIXED       (0x40)      //固定地址
#define TM1640_CMD_DATA_PLUS        (0x44)      //地址自动+1

/* 背光亮度 */
#define TM1640_CMD_LIGHT_OFF        (0X80)
#define TM1640_CMD_LIGHT_1_16       (0X89)
#define TM1640_CMD_LIGHT_2_16       (0X8A)
#define TM1640_CMD_LIGHT_4_16       (0X8B)
#define TM1640_CMD_LIGHT_10_16      (0X8C)
#define TM1640_CMD_LIGHT_12_16      (0X8D)
#define TM1640_CMD_LIGHT_13_16      (0X8E)
#define TM1640_CMD_LIGHT_14_16      (0X8F)

void tm1640_set_luminance(uint8_t cmd);
void tm1640_set_output(uint8_t *buf, uint8_t len);
void tm1640_self_test(void);
#endif
